<template>
    <header>
        我是header
        <button @click="change">切换</button>
        {{msg}}
        <br>
        {{appMsg}}
    </header>
</template>

<script>
export default {
    props:['appMsg'],
    data() {
        return {
            msg:'我是header组件'
        }
    },
    methods: {
        change(){
            this.msg='哈哈哈哈'
            this.$emit('changeApp','子组件的数据')
        }
    },
}
</script>